# use third libs
include(FetchContent)

# sqlite_modern_cpp
message("Downlaod sqlite_modern_cpp from https://gitee.com/bt-server/sqlite_modern_cpp.git")
FetchContent_Declare(
  sqlite_modern_cpp
  GIT_REPOSITORY https://gitee.com/bt-server/sqlite_modern_cpp.git
  SOURCE_DIR ${THIRD_LIB}/sqlite_modern_cpp
  GIT_SHALLOW    TRUE # 不拉取完整历史，相当于`git clone --depth=1`
  )

FetchContent_GetProperties(sqlite_modern_cpp)
if (NOT sqlite_modern_cpp_POPULATED)
  FetchContent_Populate(sqlite_modern_cpp)
endif ()

macro(use_sqlite_modern_cpp ag_project_name)
  target_compile_definitions(${ag_project_name} PRIVATE USE_LIB_sqlite_modern_cpp)
  # include sqlite_modern_cpp_SOURCE_DIR ==> sqlite_modern_cpp
  target_include_directories(${ag_project_name} PRIVATE ${sqlite_modern_cpp_SOURCE_DIR}/hdr)
endmacro(use_sqlite_modern_cpp)